package com.neulogistics.contrib.procuredcenter.infrastructure.persistence.converter;

import cn.hutool.json.JSONUtil;

import com.neulogistics.contrib.procuredcenter.domain.model.aggregate.GoodsList;
import com.neulogistics.contrib.procuredcenter.infrastructure.persistence.orm.po.GoodsListPO;
import org.springframework.beans.BeanUtils;

public class GoodsListEntityPOConverter {
    public static GoodsListPO entityToPO(GoodsList goodsList){
        if(goodsList == null)
            return null;

        GoodsListPO goodsListPO = new GoodsListPO();
        // 复制普通属性
        BeanUtils.copyProperties(goodsList, goodsListPO);

        return goodsListPO;
    }

    public static GoodsList POToEntity(GoodsListPO goodsListPO){
        if(goodsListPO == null)
            return null;

        GoodsList goodsList = new GoodsList();
        // 复制普通属性
        BeanUtils.copyProperties(goodsListPO, goodsList);

        return goodsList;
    }
}
